// import {dispatch} from 'redux'
import { GET_ARTICLE_DETAILS} from '../actionType'
import { getArticle } from '@/api/article'

export const getArticleDetails =(id)=>{
   return async dispatch=>{
        const res = await getArticle(id)
       console.log('文章数据', res.data)
      //  return { ...res.data,type:res.data.cover.type,imgs:res.data.cover.images }

        dispatch({
            type: GET_ARTICLE_DETAILS,
            payload:res.data
        })
   }
}